/**
 * 
 */
package any.gwt.client.http;

import java.util.EventObject;

import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.Response;

/**
 * TODO: Doc me
 * 
 * @author keke <keke@codehaus.org>
 * @version
 * @revision $Revision:$
 */
public class AsynClientEvent extends EventObject {

    /**
     * 
     */
    private static final long serialVersionUID = -8325006880282279350L;
    private Throwable         exception;
    private boolean           failed           = false;
    private final String      name;
    private final Request     request;
    private Response          response;

    public AsynClientEvent(final Object source, final String name,
            final boolean failed, final Request request,
            final Throwable exception) {
        super(source);
        this.name = name;
        this.failed = failed;
        this.request = request;
        this.exception = exception;
    }

    public AsynClientEvent(final Object source, final String name,
            final Request request, final Response response) {
        super(source);
        this.name = name;
        this.response = response;
        this.request = request;
    }

    public Throwable getException() {
        return exception;
    }

    public String getName() {
        return name;
    }

    public Request getRequest() {
        return request;
    }

    public Response getResponse() {
        return response;
    }

    public boolean isFailed() {
        return failed;
    }
}
